package wifiunion.com.notice.presenter;

import android.content.Context;


import java.util.HashMap;

import wifiunion.com.notice.NoticeContact;
import wifiunion.com.notice.NoticeModel;

/**
 * Created by Administrator on 2016/11/23.
 */

public class GetNoticeFromPresenter implements NoticeContact.Presenter,NoticeContact.Callback{

    private NoticeContact.View mView;
    private Context mContext;
    private NoticeModel mModel;


    private HashMap<String,Object> param = new HashMap<>();


    public GetNoticeFromPresenter(Context context, NoticeContact.View view) {
        mView = view;
        mContext = context;
        mModel = new NoticeModel();

    }

    @Override
    public void onSuccess(Object data) {
        mView.setNoticeFromSuccess(data);

    }

    @Override
    public void onServerFailed(Object errorObj) {
        mView.onError(errorObj);
    }

    @Override
    public void onNetFailed() {

        mView.onError("网络异常");
    }

    @Override
    public void start() {

    }

    @Override
    public void start(HashMap<String, Object> params) {

    }


    public void setisNotificationFrom(HashMap<String, Object> params)
    {
        mModel.setisNotificationFrom(params, this);
    }


}
